import { version1, structureDetailApi, devicesCountApi } from '../src/api';

const delay = (ms: number) =>
  new Promise(resolve => {
    setTimeout(resolve, ms);
  });

export default {
  // 1. 平台统计
  [`GET ${version1}${structureDetailApi}`]: (req: any, res: any) => {
    delay(1000);
    res.send({
      data: {
        recv_pictures: 112,
        store_pictures: 223,
        structured_pictures: 10,
        pic_face_objs: 10,
        pic_body_objs: 10,
        pic_vehicle_objs: 10,
        pic_nonvehicle_objs: 10,
        cloud_store_videos: 10,
        structured_videos: 10,
        video_face_objs: 10,
        video_body_objs: 10,
        video_vehicle_objs: 10,
        video_nonvehicle_objs: 10,
        used_storage: 10000000000000000,
        total_storage: 10000000000000000,
        total_pictures: 10,
        added_pictures: 10,
        total_videos: 10000000000000000,
        added_videos: 10000000000000000,
      },
      message: '',
      request_id: '56e83d08ea1e4c209af9b857c2a9abf8',
    });
  },

  // 2. 设备数量统计
  [`GET ${version1}${devicesCountApi}`]: (req: any, res: any) => {
    delay(1000);
    res.send({
      data: {
        count: 123456,
        access_type: {
          sdk: 56,
          sdk_online: 11,
          cig_channel: 4000,
          cig_channel_online: 399,
          cig: 123,
          cig_online: 23,
          gb: 123000,
          gb_online: 12300,
        },
        status: {
          online: 123000,
          offline: 456,
        },
        device_type: {
          common: 9,
          sphere: 1000,
          img_capture: 2000,
          soldier: 4,
          cig: 1234,
          other: 123,
        },
        function: {
          movement: 1200,
          face: 1234,
          body: 234,
          car: 1124,
          licence_plate: 12,
          other: 10000,
        },
      },
      message: '',
      request_id: '56e83d08ea1e4c209af9b857c2a9abf8',
    });
  },
};
